import java.util.Arrays;

/**
 * 功能描述
 *
 * @author songjiahao
 * @date 2023/03/10  16:35
 */
public class CHAPA {
    public static void main(String[] args) {
        int[] a = {6,5,4,3,2,1};
        a = chapa(a);
        System.out.println(Arrays.toString(a));
    }
    public static int[] chapa(int ...a){
        int min = 0;
        for (int i = 1; i < a.length; i++) {
            for (int j = i; j >0 ; j--) {
                if (a[j]>a[j-1]) {
                    break;
                }
                min = a[j];
                a[j] = a[j-1];
                a[j-1] =min;
            }
        }
        return a;
    }
}
